#include "component.h"
#include "leaf.h"
#include "composite.h"

#include <iostream>

int main()
{
    Component *c1 = new Composite("A");
    Component *c2 = new Composite("B");
    Component *l1 = new Leaf("C");
    Component *l2 = new Leaf("D");

    c1->Add(c2);
    c2->Add(l2);
    c1->Add(l1);

    c1->Operation();
    
    c1->Remove(l1);
    c2->Remove(l2);
    c1->Remove(c2);

    delete c1;
    delete c2;
    delete l1;
    delete l2;
    return 0;
}



